package top.psjj.mall.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.psjj.mall.model.query.ProductListQuery;
import top.psjj.mall.model.po.Product;
import top.psjj.mall.model.po.ProductExample;

import java.util.List;
@Repository
public interface ProductMapper {
    long countByExample(ProductExample example);

    int deleteByExample(ProductExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    List<Product> selectByExample(ProductExample example);

    Product selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Product record, @Param("example") ProductExample example);

    int updateByExample(@Param("record") Product record, @Param("example") ProductExample example);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    Product selectByName(String name);

    void updateBatchSellStatus(@Param("ids") Integer[] ids, @Param("status") Integer sellStatus);

    List<Product> selectByList(ProductListQuery productListQuery);
}